<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import = "com.qm.hibernate.Tuser" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>管理用户</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="../Css/styles.css">
  </head>
  <% 
 		List<Tuser> users = (List<Tuser>)session.getAttribute("allUsers");
 		 
   %>
  <body>
   <div id = "header">
	   <a style = "float:left;border-right:solid 2px;padding-right:8px" href = "adminIndex?type=posts">所有帖子</a>
	   <a style = "float:left;padding-left:8px" href = "adminIndex?type=users">所有用户</a>
      <a style = "float:right;padding-right:8px;color:red" href = "logout" >注销</a><br/>
   </div>
   <div id = "container">
   	<table>
   	<tr>
   	<th>用户名</th>
   	<th>操作</th>
   	</tr>
   	<%for(int i = 0;i < users.size();i++){ %>
   	<tr>
   	<td><a href = "hisIndex?id=<%=users.get(i).getId()%>"><%=users.get(i).getName()%></a>
   	</td>
   	<td>
   	<%if (!"admin".equals(users.get(i).getRole())){ %>
   	<a href = "adminIndex?id=<%=users.get(i).getId()%>&method=delUser">删除用户</a>
   	<%}%>
   	</td>
   	</tr>
   	<%} %>
   	</table>
   </div>
   <div id = "footer">
   
   </div>
  </body>
</html>
